package com.gla.market.entity;

import java.io.Serializable;
import java.text.DecimalFormat;

public class Commodity implements Serializable {
    private Integer id;
    private String name;
    private Float price;
    private Integer number;
    private Integer p_o_u;
    private Type type;
    private Shop shop;
    private String details;
    private String introduction;
    private String photo;

    public Commodity() {
    }

    public Commodity(Integer id, String name, Float price, Integer number, Integer p_o_u, Type type, Shop shop, String details, String introduction, String photo) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.number = number;
        this.p_o_u = p_o_u;
        this.type = type;
        this.shop = shop;
        this.details = details;
        this.introduction = introduction;
        this.photo = photo;
    }

    public String getPriceShow(){
        DecimalFormat df=new DecimalFormat("#.00");
        return df.format(price);
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public Integer getP_o_u() {
        return p_o_u;
    }

    public void setP_o_u(Integer p_o_u) {
        this.p_o_u = p_o_u;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public Shop getShop() {
        return shop;
    }

    public void setShop(Shop shop) {
        this.shop = shop;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    @Override
    public String toString() {
        return "Commodity{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", number=" + number +
                ", p_o_u=" + p_o_u +
                ", type=" + type +
                ", shop=" + shop +
                ", details='" + details + '\'' +
                ", introduction='" + introduction + '\'' +
                ", photo='" + photo + '\'' +
                '}';
    }
}
